package main

import (
	"fmt"
	"log"

	"grpc-jwt-yonghurenzheng/jwt_grpc_gin/config"
	"grpc-jwt-yonghurenzheng/jwt_grpc_gin/handlers"

	"github.com/gin-gonic/gin"
)

func main() {
	config.InitDB()
	router := gin.Default()
	
	// 提供获取用户信息的接口
	// 例如: GET /users/123
	router.GET("/users/:id", handlers.GetProfileHandler)
	router.DELETE("/delete_users/:id",  handlers.DeleteUser)

	port := "8082"
	fmt.Printf("🚀 User Service (Gin) 启动于 http://localhost:%s\n", port)
	if err := router.Run(":" + port); err != nil {
		log.Fatalf("服务启动失败: %v", err)
	}
}